//
//  HomeViewCell.m
//  ZzzzyManProject
//
//  Created by mac on 16/3/1.
//  Copyright © 2016年 ZzzzyMan@. All rights reserved.
//

#import "HomeViewCell.h"
#import <UIImageView+WebCache.h>

@interface HomeViewCell()
@property (weak, nonatomic) IBOutlet UIImageView *image;
@property (weak, nonatomic) IBOutlet UILabel *title;
@property (weak, nonatomic) IBOutlet UILabel *date;
@property (weak, nonatomic) IBOutlet UILabel *source;


@end
@implementation HomeViewCell

- (void)setNewsModel:(NewsModel *)newsModel {
    _newsModel = newsModel;
    
    if(!newsModel.isOpen) {
    [self.image sd_setImageWithURL:[NSURL URLWithString:newsModel.imageName] placeholderImage:[UIImage imageNamed:@"MarvelNewsimg"]];
    self.title.text = newsModel.title;
    self.date.text = newsModel.data;
    self.source.text = newsModel.source;
    self.title.hidden = false;
    self.date.hidden = false;
    self.source.hidden = false;
    }
    
    else {
        self.title.hidden = true;
        self.date.hidden = true;
        self.source.hidden = true;
        [self.image sd_setImageWithURL:[NSURL URLWithString:newsModel.imageName] placeholderImage:[UIImage imageNamed:@"MarvelNewsimg"]];
        self.image.frame = CGRectMake(0, 0, 50, 50);
    }
    
}


@end
